import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/set/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'home',
        component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue')
    },
    {
        path: '/login',
        name: 'login',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/set/LoginView.vue')
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('../views/set/RegisterView.vue')
    },
    {
        path: '/records',
        name: 'records',
        meta: { keepAlive: true },
        component: () => import('../views/RecordsView.vue')
    },
    {
        path: '/user',
        name: 'user',
        meta: { keepAlive: true },
        component: () => import('../views/UserView.vue')
    },
    {
        path: '/setting',
        name: 'setting',
        component: () => import('../views/set/SettingView.vue')
    },
    {
        path: '/registershop',
        name: 'registershop',
        component: () => import('../views/set/Registershop.vue')
    },
    {
        path: '/personal',
        name: 'personal',
        component: () => import('../views/set/PersonalView.vue')
    },
    {
        path: '/about',
        name: 'about',
        component: () => import('../views/set/AboutView.vue')
    },
    {
        path: '/privacy',
        name: 'privacy',
        component: () => import('../views/set/PrivacyView.vue')
    },
    {
        path: '/feedback',
        name: 'feedback',
        component: () => import('../views/set/FeedbackView.vue')
    },
    {
        path: '/connect',
        name: 'connect',
        component: () => import('../views/set/ConnectView.vue')
    },
    {
        path: '/order',
        name: 'order',
        component: () => import('../views/record/OrderView.vue')
    },
    {
        path: '/handleorders',
        name: 'handleOrders',
        component: () => import('../views/shoper/HandleOrders.vue')
    },
    {
        path: '/handleshop',
        name: 'handleShop',
        component: () => import('../views/shoper/HandleShop.vue')
    },
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
